<?php

include_once '../../Core/Conexion.php';
include_once '../../Core/ControladorSet.php';
include_once '../../Core/InterfazDatos.php';
///****
include_once '../../Admin/entidades/Alumno.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of lista
 *
 * @author home
 */
class lista extends ControladorSet {

    public function buscarValores() {
        //$this->verificarSeccion('../../index1.php');
        $tabla = "";
        $entidad = new Alumno("","","","","","","","");
        // $consulta=$this->conexion->consultaLibre('SELECT A.CEDULAREPRESENTANTE,A.CODIGOALUMNO,A.PRIMERNOMBREALUMNO,A.PRIMERAPELLIDOALUMNO,A.DIRECCIONALUMNO,A.GENEROALUMNO,A.TELEFONOALUMNO,C.NOMBRECURSO,C.PARALELOCURSO FROM ALUMNO A,CURSO C WHERE A.CODIGOCURSO=C.CODIGOCURSO ORDER BY C.CODIGOCURSO,PRIMERAPELLIDOALUMNO,SEGUNDOAPELLIDOALUMNO,PRIMERNOMBREALUMNO,SEGUNDONOMBREALUMNO');
        $consulta = $this->conexion->consultaTabla($entidad);
        $fila = mysql_fetch_array($consulta);

        do {
            $tabla = $tabla . "<tr>";
            $tabla = $tabla . "<td>" . $fila[0] . "</td>";
            $tabla = $tabla . "<td>" . $fila[1] . "</td>";
            $tabla = $tabla . "<td>" . $fila[2]." ".$fila[3]. "</td>";
            $tabla = $tabla . "<td>" . $fila[4] . "</td>";            
            $tabla = $tabla . "<td>" . $fila[7] . "</td>";


            $tabla = $tabla . "<td>" . "<a href='editar.php?codigo=" . $fila[0] . "' >edit</a>" . "</td>";
            $tabla = $tabla . "<td>" . "<a onclick='return confirm(\"Seguro que desea eliminar estos datos?\");' href=php/Eliminar.php?codigo=" . $fila[0] . " >elimr<a>" . "</td>";
            $tabla = $tabla . "</tr>";
        } while ($fila = mysql_fetch_array($consulta));

        $this->diccionario['tabla'] = $tabla;
        
        if(!isset($_REQUEST['error']))
        {
            $this->diccionario['mensaje']="-1";
        }
        else
        {
            $this->diccionario['mensaje']=$_REQUEST['error'];
        }
        
        
    }
    
    public function setValorSesion() 
    {
 
        $this->valorSesion=array("profe");
        
    }

    public function setDiccionario() {
        
        $this->diccionario = array(
            "tabla" => "vacio",
            "mensaje"=>"",
        );
    }

   

//put your code here
}

$controlador = new lista('listaVista.php');
$controlador->rederizarPagina();
